<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>虚拟奶龙 - 注册</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#FFD166', // 主色调：奶龙黄
                        secondary: '#06D6A0', // 辅助色：薄荷绿
                        neutral: '#FFF9E6', // 背景色：淡黄色
                        dark: '#292F36', // 文本色：深灰
                    },
                    fontFamily: {
                        sans: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .text-shadow {
                text-shadow: 0 2px 4px rgba(0,0,0,0.1);
            }
            .bg-gradient-custom {
                background: linear-gradient(135deg, #FFD166 0%, #FFAA00 100%);
            }
            .card-hover {
                transition: all 0.3s ease;
            }
            .card-hover:hover {
                transform: translateY(-8px); /* 增加悬浮高度 */
                box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.15), 0 10px 20px -5px rgba(0, 0, 0, 0.1); /* 加深阴影 */
            }
        }
    </style>
</head>
<body class="bg-neutral min-h-screen flex flex-col">
    <!-- 导航栏 -->
    <nav class="bg-white shadow-md sticky top-0 z-50 transition-all duration-300" id="navbar">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex justify-between h-16">
                <div class="flex items-center">
                    <a href="#" class="flex-shrink-0 flex items-center">
                        <i class="fa fa-dragon text-primary text-2xl mr-2"></i>
                        <span class="font-bold text-xl text-dark">虚拟奶龙</span>
                    </a>
                </div>
                <div class="flex items-center">
                    <a href="{{ url_for('login') }}" class="text-dark hover:text-primary px-3 py-2 rounded-md text-sm font-medium transition-colors duration-200">
                        登录
                    </a>
                </div>
            </div>
        </div>
    </nav>

    <!-- 主要内容 -->
    <main class="flex-grow flex items-center justify-center p-4">
        <div class="w-full max-w-4xl">
            <div class="bg-white rounded-xl shadow-lg overflow-hidden transform transition-all duration-500 card-hover">
                <div class="flex flex-col md:flex-row">
                    <!-- 左侧：奶龙图片 -->
                    <div class="w-full md:w-2/5 bg-gradient-custom p-8 flex flex-col justify-center items-center text-white">
                        <img src="{{ url_for('static', filename='images/奶龙.jpg') }}" alt="奶龙形象" class="w-48 h-48 mx-auto rounded-full object-cover shadow-xl border-4 border-white mb-6">
                        <h2 class="text-3xl font-bold mb-2 text-shadow">创建新账户</h2>
                        <p class="text-white/80 text-center">加入虚拟奶龙，开启有趣的对话体验</p>
                        <div class="mt-8 flex flex-col space-y-4 w-full">
                            <div class="flex items-center">
                                <div class="w-10 h-10 rounded-full bg-white/20 flex items-center justify-center mr-3">
                                    <i class="fa fa-user-plus text-white"></i>
                                </div>
                                <div>
                                    <h4 class="font-medium">快速注册</h4>
                                    <p class="text-sm text-white/80">只需简单几步，即可完成注册</p>
                                </div>
                            </div>
                            <div class="flex items-center">
                                <div class="w-10 h-10 rounded-full bg-white/20 flex items-center justify-center mr-3">
                                    <i class="fa fa-comments text-white"></i>
                                </div>
                                <div>
                                    <h4 class="font-medium">智能对话</h4>
                                    <p class="text-sm text-white/80">与奶龙进行自然流畅的对话</p>
                                </div>
                            </div>
                            <div class="flex items-center">
                                <div class="w-10 h-10 rounded-full bg-white/20 flex items-center justify-center mr-3">
                                    <i class="fa fa-shield text-white"></i>
                                </div>
                                <div>
                                    <h4 class="font-medium">安全保障</h4>
                                    <p class="text-sm text-white/80">您的信息将得到严格保护</p>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- 右侧：注册表单 -->
                    <div class="w-full md:w-3/5 p-8">
                        {% if error %}
                            <div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4 relative" role="alert">
                                <strong class="font-bold">错误!</strong>
                                <span class="block sm:inline">{{ error }}</span>
                            </div>
                        {% endif %}
                        <h3 class="text-2xl font-bold text-dark mb-6">创建您的账户</h3>
                        <form method="POST" action="{{ url_for('register') }}" class="space-y-4">
                            <div>
                                <label for="username" class="block text-sm font-medium text-gray-700 mb-1">用户名</label>
                                <div class="relative">
                                    <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                        <i class="fa fa-user text-gray-400"></i>
                                    </div>
                                    <input type="text" name="username" id="username" required
                                        class="pl-10 block w-full rounded-md border-gray-300 shadow-sm focus:border-primary focus:ring focus:ring-primary/20 focus:ring-opacity-50 transition-all duration-200"
                                        placeholder="请输入用户名">
                                </div>
                            </div>
                            <div>
                                <label for="password" class="block text-sm font-medium text-gray-700 mb-1">密码</label>
                                <div class="relative">
                                    <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                        <i class="fa fa-lock text-gray-400"></i>
                                    </div>
                                    <input type="password" name="password" id="password" required
                                        class="pl-10 block w-full rounded-md border-gray-300 shadow-sm focus:border-primary focus:ring focus:ring-primary/20 focus:ring-opacity-50 transition-all duration-200"
                                        placeholder="请输入密码">
                                </div>
                            </div>
                            <div>
                                <label for="confirm_password" class="block text-sm font-medium text-gray-700 mb-1">确认密码</label>
                                <div class="relative">
                                    <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                        <i class="fa fa-lock text-gray-400"></i>
                                    </div>
                                    <input type="password" name="confirm_password" id="confirm_password" required
                                        class="pl-10 block w-full rounded-md border-gray-300 shadow-sm focus:border-primary focus:ring focus:ring-primary/20 focus:ring-opacity-50 transition-all duration-200"
                                        placeholder="请再次输入密码">
                                </div>
                            </div>
                            <div>
                                <button type="submit" class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-primary hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary/20 focus:ring-opacity-50 transition-all duration-200 transform hover:scale-[1.02] active:scale-[0.98]">
                                    <i class="fa fa-user-plus mr-2"></i>注册
                                </button>
                            </div>
                        </form>
                        <div class="mt-6">
                            <div class="relative">
                                <div class="absolute inset-0 flex items-center">
                                    <div class="w-full border-t border-gray-300"></div>
                                </div>
                                <div class="relative flex justify-center text-sm">
                                    <span class="px-2 bg-white text-gray-500">已有账户?</span>
                                </div>
                            </div>
                            <div class="mt-6">
                                <a href="{{ url_for('login') }}" class="w-full flex justify-center py-2 px-4 border border-primary rounded-md shadow-sm text-sm font-medium text-primary hover:bg-primary/5 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary/20 focus:ring-opacity-50 transition-all duration-200">
                                    <i class="fa fa-sign-in mr-2"></i>立即登录
                                </a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>

    <!-- 页脚 -->
    <footer class="bg-dark text-white py-6">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <div class="flex items-center">
                        <i class="fa fa-dragon text-primary text-xl mr-2"></i>
                        <span class="font-bold text-lg">虚拟奶龙</span>
                    </div>
                    <p class="text-white/70 text-sm mt-1">让对话更加有趣</p>
                </div>
                <div class="flex space-x-4">
                    <a href="#" class="text-white/70 hover:text-primary transition-colors duration-200">
                        <i class="fa fa-github text-xl"></i>
                    </a>
                    <a href="#" class="text-white/70 hover:text-primary transition-colors duration-200">
                        <i class="fa fa-twitter text-xl"></i>
                    </a>
                    <a href="#" class="text-white/70 hover:text-primary transition-colors duration-200">
                        <i class="fa fa-weixin text-xl"></i>
                    </a>
                </div>
            </div>
            <div class="mt-6 pt-6 border-t border-white/10 text-center text-white/50 text-sm">
                <p>© 2025 虚拟奶龙系统. 保留所有权利.</p>
            </div>
        </div>
    </footer>

    <script>
        // 导航栏滚动效果
        window.addEventListener('scroll', function() {
            const navbar = document.getElementById('navbar');
            if (window.scrollY > 10) {
                navbar.classList.add('bg-white/95', 'backdrop-blur-sm');
                navbar.classList.remove('bg-white');
            } else {
                navbar.classList.add('bg-white');
                navbar.classList.remove('bg-white/95', 'backdrop-blur-sm');
            }
        });
    </script>
</body>
</html>